home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Interfaces / PInterfaces / ConditionalMacros.p < prev    next >
Encoding:
Text File  |  1994-11-11  |  5.2 KB  |  163 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        ConditionalMacros.p
  3.  
  4.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  5.                  All rights reserved.
  6.  
  7.      Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. }
  16.  
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT ConditionalMacros;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __CONDITIONALMACROS__}
  27. {$SETC __CONDITIONALMACROS__ := 1}
  28.  
  29. {$I+}
  30. {$SETC ConditionalMacrosIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33.  
  34. {$PUSH}
  35. {$ALIGN MAC68K}
  36. {$LibExport+}
  37. {
  38.     This file sets up the following compiler independent conditionals:
  39.     
  40.     GENERATINGPOWERPC        - Compiler is generating PowerPC instructions
  41.     GENERATING68K            - Compiler is generating 68k family instructions
  42.     GENERATING68881            - Compiler is generating mc68881 floating point instructions
  43.     GENERATINGCFM            - Code being generated assumes CFM calling conventions
  44.     CFMSYSTEMCALLS            - No A-traps.  Systems calls are made using CFM and UPP's
  45.     
  46.     SystemSevenFiveOrLater    - Compiled code will only be run on a System 7.5 or later Macintosh
  47.     SystemSevenOrLater        - Compiled code will only be run on a System 7.0 or later Macintosh
  48.     SystemSixOrLater        - Compiled code will only be run on a System 6.0 or later Macintosh
  49.                               A developer should set the appropriate flag on the compiler command-
  50.                               line or in a file processed before this file.  This will allow the
  51.                               certain optimizations to be made which can result in smaller, faster
  52.                               applications.
  53.     
  54.     CGLUESUPPORTED            - Interface library will support "C glue" functions (function names
  55.                               are: all lowercase, use C strings instead of pascal strings, use 
  56.                               Point* instead of Point).
  57.  
  58.     OLDROUTINENAMES            - "Old" names for Macintosh system calls are allowed in source code.
  59.                               (e.g. DisposPtr instead of DisposePtr). The names of system routine
  60.                               are now more sensitive to change because CFM binds by name.  In the 
  61.                               past, system routine names were compiled out to just an A-Trap.  
  62.                               Macros have been added that each map an old name to its new name.  
  63.                               This allows old routine names to be used in existing source files,
  64.                               but the macros only work if OLDROUTINENAMES is true.  This support
  65.                               will be removed in the near future.  Thus, all source code should 
  66.                               be changed to use the new names! You can set OLDROUTINENAMES to false
  67.                               to see if your code has any old names left in it.
  68.     
  69.     OLDROUTINELOCATIONS     - "Old" location of Macintosh system calls are used.  For example, c2pstr 
  70.                               has been moved from Strings to TextUtils.  It is conditionalized in
  71.                               Strings with OLDROUTINELOCATIONS and in TextUtils with !OLDROUTINELOCATIONS.
  72.                               This allows developers to upgrade to newer interface files without suddenly
  73.                               all their code not compiling becuase of "incorrect" includes.  But, it
  74.                               allows the slow migration of system calls to more understandable file
  75.                               locations.  OLDROUTINELOCATIONS currently defaults to true, but eventually
  76.                               will default to false.
  77.     
  78.     
  79.     There are some invariants among the conditionals:
  80.     
  81.     GENERATINGPOWERPC != GENERATING68K
  82.     GENERATING68881 => GENERATING68K
  83.     GENERATINGPOWERPC => GENERATINGCFM
  84.     GENERATINGPOWERPC => CFMSYSTEMCALLS
  85.     CFMSYSTEMCALLS => GENERATINGCFM
  86.     GENERATINGPOWERPC => SystemSevenOrLater
  87.     SystemSevenFiveOrLater => SystemSevenOrLater
  88.     SystemSevenOrLater => SystemSixOrLater
  89.     
  90.     
  91. }
  92. {$IFC UNDEFINED LSPWRP }
  93. {$SETC LSPWRP := 0}
  94. {$ENDC}
  95. {$IFC UNDEFINED LSP68K }
  96. {$SETC LSP68K := NOT LSPWRP}
  97. {$ENDC}
  98. {$IFC UNDEFINED GENERATINGPOWERPC }
  99. {$SETC GENERATINGPOWERPC := LSPWRP}
  100. {$ENDC}
  101. {$IFC UNDEFINED GENERATING68K }
  102. {$SETC GENERATING68K := LSP68K}
  103. {$ENDC}
  104. {$IFC GENERATING68K  & OPTION(mc68881) }
  105. {$SETC GENERATING68881 := 001}
  106. {$ENDC}
  107. {$IFC UNDEFINED GENERATING68881 }
  108. {$SETC GENERATING68881 := 0}
  109. {$ENDC}
  110. {$IFC GENERATINGPOWERPC }
  111. {$SETC CFMSYSTEMCALLS := 1}
  112. {$SETC GENERATINGCFM := 1}
  113. {$ENDC}
  114. {$IFC UNDEFINED GENERATINGCFM }
  115.  {$IFC UNDEFINED __CFM68K__ }
  116. {$SETC GENERATINGCFM := 0}
  117. {$SETC CFMSYSTEMCALLS := 0}
  118.  {$ELSEC}
  119. {$SETC GENERATINGCFM := 1}
  120. {$SETC CFMSYSTEMCALLS := 1}
  121.  {$ENDC}
  122. {$ENDC}
  123. {$IFC UNDEFINED CFMSYSTEMCALLS }
  124. {$SETC CFMSYSTEMCALLS := 0}
  125. {$ENDC}
  126. {$IFC UNDEFINED SystemSevenFiveOrLater }
  127. {$SETC SystemSevenFiveOrLater := 0}
  128. {$ENDC}
  129. {$IFC UNDEFINED OLDROUTINENAMES }
  130. {$SETC OLDROUTINENAMES := 1}
  131. {$ENDC}
  132. {$IFC UNDEFINED OLDROUTINELOCATIONS }
  133. {$SETC OLDROUTINELOCATIONS := 1}
  134. {$ENDC}
  135. {$IFC UNDEFINED SystemSevenOrLater }
  136.  {$IFC GENERATINGCFM  | SystemSevenFiveOrLater }
  137. {$SETC SystemSevenOrLater := 1}
  138.  {$ELSEC}
  139. {$SETC SystemSevenOrLater := 0}
  140.  {$ENDC}
  141. {$ENDC}
  142. {$IFC UNDEFINED SystemSixOrLater }
  143. {$SETC SystemSixOrLater := SystemSevenOrLater}
  144. {$ENDC}
  145. {$IFC OLDROUTINENAMES }
  146.  {$IFC UNDEFINED USES68KINLINES }
  147. {$SETC USES68KINLINES := GENERATING68K}
  148.  {$ENDC}
  149. {$SETC USESCODEFRAGMENTS := GENERATINGCFM}
  150. {$SETC USESROUTINEDESCRIPTORS := GENERATINGCFM}
  151. {$ENDC}
  152.  
  153. {$ALIGN RESET}
  154. {$POP}
  155.  
  156. {$SETC UsingIncludes := ConditionalMacrosIncludes}
  157.  
  158. {$ENDC} {__CONDITIONALMACROS__}
  159.  
  160. {$IFC NOT UsingIncludes}
  161.  END.
  162. {$ENDC}
  163.